import {requestService} from '/src/utils/request'

// 根据字典类型查询字典数据信息
export function getDicts(dictType) {
    return requestService({
        url: '/xiaozhen-system/sysDict/data/type/' + dictType,
        method: 'get'
    })
}

// 根据条件查询字典类型列表
export function getDictTypeList(query) {
    return requestService({
        url: '/xiaozhen-system/sysDict/type/list',
        method: 'get',
        params: query
    })
}

// 新增字典类型
export function addSysDictType(data) {
    return requestService({
        url: '/xiaozhen-system/sysDict/type/add',
        method: 'post',
        data: data
    })
}

// 修改字典类型
export function updateSysDictType(data) {
    return requestService({
        url: '/xiaozhen-system/sysDict/type/update',
        method: 'put',
        data: data
    })
}

// 删除字典类型
export function deleteSysDictType(dictId) {
    return requestService({
        url: '/xiaozhen-system/sysDict/type/' + dictId,
        method: 'delete'
    })
}

// 新增字典数据
export function addSysDictData(data) {
    return requestService({
        url: '/xiaozhen-system/sysDict/data/add',
        method: 'post',
        data: data
    })
}

// 修改字典数据
export function updateSysDictData(data) {
    return requestService({
        url: '/xiaozhen-system/sysDict/data/update',
        method: 'put',
        data: data
    })
}

// 删除字典数据
export function deleteSysDictData(dictCode) {
    return requestService({
        url: '/xiaozhen-system/sysDict/data/' + dictCode,
        method: 'delete'
    })
}
